//
//  KCHomeFootView.m
//  Golden
//
//  Created by king on 2017/8/16.
//  Copyright © 2017年 KC. All rights reserved.
//

#import "KCHomeFootView.h"
#import "KCPushUtility.h"

@interface KCHomeFootView ()

@end

@implementation KCHomeFootView

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = COLOR_FOR_BG;
    }
    return self;
}

+ (instancetype)footView:(NSInteger)index {
    
    KCHomeFootView *footView = [[KCHomeFootView alloc]init];
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.tag = HOME_TAG + index;
    btn.frame = CGRectMake(0, 0, SCREEN_WIDTH, 40);
    btn.backgroundColor = WHITE_COLOR;
    btn.titleLabel.font = SYSTEM_FONT(FONTS_14);
//    [btn setImage:[UIImage imageNamed:@"quotation_indicator_normal"] forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [btn setTitle:@"查看全部" forState:UIControlStateNormal];
    [btn addTarget:footView action:@selector(footAction:)forControlEvents:UIControlEventTouchUpInside];
    [footView addSubview:btn];
    return footView;
    
}

- (void)footAction:(UIButton *)btn{

    KCLog(@"1");
    if (btn.tag == HOME_TAG) {
        
        goNewsList(self.viewController);
        
    }else if (btn.tag == HOME_TAG + 1) {
        
        goUserList(self.viewController);
        
    }else if (btn.tag == HOME_TAG + 2) {
        
        goAuthorList(self.viewController);
        
    }else {
        
    }
    
}

@end
